<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script>
        window.hdjs = {};
        window.hdjs.base = '../';
        window.hdjs.uploader = 'php/uploader.php?';
        window.hdjs.filesLists = 'php/filesLists.php?';
    </script>
    <script src="../dist/static/requirejs/require.js"></script>
    <script src="../dist/static/requirejs/config.js"></script>
</head>
<body style="padding: 50px;">
<h1 onclick="base()">基本使用</h1>
<script>
    function base() {
        require(['hdjs'], function (hdjs) {
            var modalObj = hdjs.modal({
                title: '友情提示你哟',//标题
                content: '后盾人 人人做后盾',//内容
                footer: '<button type="button" class="btn btn-default confirm" data-dismiss="modal">关闭</button>',//底部
                events: {
                    confirm: function () {
                        //哪个元素上有.confirm类，被点击就执行这个回调
                        alert('点击了关闭按钮');
                    }
                }
            });
        });
    }
</script>

<h1 onclick="ajax()">远程加载</h1>
<script>
    function ajax() {
        require(['hdjs'], function (hdjs) {
            hdjs.modal({
                //加载的远程地址
                content: ['http://hdjstest.hdphp.com/test/'],
                title: '添加用户',
                width: 800,
                show: true,//直接显示
            });
        });
    }
</script>

<h1 onclick="post()">加载并传递POST数据</h1>
<script>
    function post() {
        require(['hdjs'], function (hdjs) {
            hdjs.modal({
                //加载的远程地址
                content: ['./', {name: '后盾网'}],
                title: '添加站点',
                width: 800
            });
        });
    }
</script>
</body>
</html>